package com.app.fenak;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.AdapterView;
import android.widget.AdapterView.OnItemClickListener;
import android.widget.ListView;

public class MainActivity extends Activity {
	
	private ListView listView;
	
    /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main_view);
        
        listView = (ListView) findViewById(R.id.options_list);
        listView.setAdapter(new MainOptionsAdapter(this.getApplicationContext()));
        listView.setOnItemClickListener(new OnItemClickListener() {

			@Override
			public void onItemClick(AdapterView<?> adapter, View view, int pos,
					long id) {
				switch (pos) {
				case 0:
					MainActivity.this.startActivity(new Intent(MainActivity.this, SessionActivity.class));
					break;
					
				case 1:
					MainActivity.this.startActivity(new Intent(MainActivity.this, DrawPathActivity.class));
					break;
					
				case 2:
					MainActivity.this.startActivity(new Intent(MainActivity.this, UsePathActivity.class));
					break;
					
				case 3:
					MainActivity.this.startActivity(new Intent(MainActivity.this, AddContactActivity.class));
					break;
					
				default:
					break;
				} 
			}
		});
    }
}